package com.longge.wechat.socket;

import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.net.UnknownHostException;

public class TCPClient {
	public static void main(String[] args) {
		try {
			Socket s = new Socket("127.0.0.1", 5555);
			OutputStream os = s.getOutputStream();
			DataOutputStream dos = new DataOutputStream(os);
			/*try {
				Thread.sleep(30000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}*/
			dos.writeUTF("你好，服务端!!");
			dos.flush();
			dos.close();
			s.close();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
